package com.lagou.edu.course.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lagou.edu.course.entity.Lesson;
import com.lagou.edu.course.mapper.LessonMapper;
import com.lagou.edu.course.service.ILessonService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 课程节内容 服务实现类
 *
 * @author lm
 * @since 2021/10/25 15:42
 */
@Service
public class LessonServiceImpl extends ServiceImpl<LessonMapper, Lesson> implements ILessonService {
    @Override
    public List<Lesson> getLessonsBySectionId(Integer sectionId) {
        QueryWrapper<Lesson> queryWrapper = new QueryWrapper<>();
        queryWrapper.lambda().eq(Lesson::getSectionId, sectionId);
        return this.getBaseMapper().selectList(queryWrapper);
    }
}
